<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 电影数据可视化</title>
    <link rel="stylesheet" href="./css/index.css">
    <style>
        .login-container {
            width: 100%;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            /* background: url(../image/bg.jpg) no-repeat; */
            background-size: cover;
        }

        .login-box {
            width: 400px;
            padding: 40px;
            background: rgba(0, 242, 241, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 8px;
            border: 1px solid #00f2f1;
        }

        .login-title {
            text-align: center;
            color: #fff;
            font-size: 24px;
            margin-bottom: 30px;
        }

        .login-form {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .form-group label {
            color: #fff;
            font-size: 14px;
        }

        .form-group input {
            padding: 10px;
            border: 1px solid #00f2f1;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            font-size: 14px;
        }

        .form-group input:focus {
            outline: none;
            border-color: #4c9bfd;
        }

        .login-btn {
            padding: 12px;
            background: #00f2f1;
            border: none;
            border-radius: 4px;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .login-btn:hover {
            background: #4c9bfd;
            transform: translateY(-2px);
        }

        .error-message {
            color: #ff4d4f;
            font-size: 14px;
            text-align: center;
            display: none;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="login-box">
            <h2 class="login-title">电影数据可视化系统</h2>
            <form class="login-form" id="loginForm">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" id="username" name="username" required>
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" id="password" name="password" required>
                </div>
                <div class="error-message" id="errorMessage">用户名或密码错误</div>
                <button type="submit" class="login-btn">登录</button>
            </form>
        </div>
    </div>

    <script>
        document.getElementById('loginForm').addEventListener('submit', function(e) {
            e.preventDefault();
            
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            
            // 这里可以添加实际的用户名和密码验证逻辑
            if (username === 'admin' && password === 'admin123') {
                // 登录成功，存储登录状态
                localStorage.setItem('token', 'true');
                localStorage.setItem('username', username);
                
                // 跳转到主页
                window.location.href = 'index.html';
            } else {
                // 显示错误信息
                document.getElementById('errorMessage').style.display = 'block';
            }
        });
    </script>
</body>
</html> 